//
//  MYXChangePhoneViewController.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/14.
//  Copyright © 2017年 hbjApple. All rights reserved.
//绑定手机号吗

#import "MYXChangePhoneViewController.h"
#import "MYXVerificationIphoneController.h"
#import "TelFriendViewController.h"
#import "MYXMemberMdel.h"
#import "userinfoModel.h"
@interface MYXChangePhoneViewController ()
@property (weak, nonatomic) IBOutlet UILabel *IphoneLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@property (weak, nonatomic) IBOutlet UILabel *titileLabel;
@property(nonatomic,strong)userinfoModel *userinfoMode;
@property (weak, nonatomic) IBOutlet UIButton *iphoneButt;
@property (weak, nonatomic) IBOutlet UIButton *changButton;

@end

@implementation MYXChangePhoneViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.userinfoMode =[[userinfoModel alloc]init];
    self.userinfoMode = [MYXMemberMdel sharedInstance].userinfo;
    [self initSetUI];
}

-(void)initSetUI{
    self.changButton.hidden = YES;
    self.IphoneLabel.text =[NSString stringWithFormat:@"绑定的手机号：%@",self.userinfoMode.phone];
    if ([self.userinfoMode.is_match isEqualToString:@"0"]) {
        self.titileLabel.text= @"未启用通讯录，去设置里面去开启通讯录";
        self.iphoneButt.enabled =NO;
        [self.iphoneButt setBackgroundColor:MYYColorFromRGB(0xA6A6A6)];
        
    }else if ([self.userinfoMode.is_match isEqualToString:@"1"]){
        self.iphoneButt.enabled =  YES;
    }
}
- (IBAction)iphoneButton:(UIButton *)sender {
    TelFriendViewController *TelFriendVC =[[TelFriendViewController alloc]init];
    TelFriendVC.navigationItem.title = @"通讯录好友";
    TelFriendVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:TelFriendVC animated:YES];
    
}
- (IBAction)changePButton:(UIButton *)sender {
    MYXVerificationIphoneController *MYXVerificationIphoneVC =[[MYXVerificationIphoneController alloc]init];
    MYXVerificationIphoneVC.navigationItem.title = @"验证手机";
    MYXVerificationIphoneVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:MYXVerificationIphoneVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
